package com.art.sunflower.util;

import org.springframework.web.multipart.MultipartFile;

public class AddFile {
    public String addFile(MultipartFile mfile, String type) {
        //1定义要上传文件 的存放路径
        String localPath = "C:/Users/Administrator/Desktop/resource/" + type;
        //2获得文件名字
        String fileName = mfile.getOriginalFilename();
        //2上传失败提示
        String warning = "";
        String real = FileUtils.upload(mfile, localPath, fileName);
        String address = "http://120.27.233.52:8080/" + type + "/" + real;
        return address;
    }
}
